﻿
@{
    Layout = null;
    var collection = ViewBag.coures as List<WebApplication2.Models.Course>;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <style>
        *{
            text-align:center;
        }
       th{
           background-color:red;
       }
       .td-green{
           background-color:forestgreen;
       }
    </style>
</head>
<body >
    <div>
        <table border="1" >
            <thead>
                <tr>
                    <th>
                        ID
                    </th>
                    <th>
                        Title
                    </th>
                    <th>
                        Credits
                    </th>
                    <th>
                        DepartmentID
                    </th>
                </tr>
            </thead>

            <tbody>
                @foreach (var item in collection)
                {
                    <tr class="td-green">
                        <td>
                            @item.CourseID
                        </td>
                        <td >
                            @item.Title
                        </td>
                        <td >
                            @item.Credits
                        </td>
                        <td>
                            @item.DepartmentID
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>

</body>
</html>
